<%@ include file="/jsp/include.jsp" %>

<%
String redirect = ParamUtil.getString(request, "redirect");
String backURL = ParamUtil.getString(request, "backURL", redirect);
%>

<portlet:actionURL var="formAction">
    <portlet:param name="action" value="editBook"/>
</portlet:actionURL>

<c:set var="namespace" value="<%= renderResponse.getNamespace() %>"/>
<h3><liferay-ui:message key="Book.Edit.Title" /></h3>
<form:form name="${namespace}fm" modelAttribute="book" method="post" action="${formAction}">
   <form:errors path="*" cssStyle="color:red"/>
	<liferay-util:include page="//jsp/book/toolbar.jsp" servletContext="<%=this.getServletContext() %>">
		<liferay-util:param name="toolbarItem" value="add"></liferay-util:param>
	</liferay-util:include>
	<form:hidden path="bookId"/>
		<table class="lfr-table">
			<tr height="25">
		    	<td><liferay-ui:message key="Book.Title" /><liferay-ui:message key="autosoft_asteric" /></td>
		    	<td><form:input path="title" size="100" maxlength="128"/></td>
 				</tr>
		</table>
	<div class="separator"><!-- --></div>
	<aui:button type="submit" value="Command.Save" /> 
	<%
		String taglibOnClick = "location.href = '" + HtmlUtil.escape(redirect) + "';";
	%>
	<aui:button type="button" value="Command.Cancel"  onClick="<%= taglibOnClick %>" />
</form:form>

<c:if test="<%= windowState.equals(WindowState.MAXIMIZED) %>">
	<aui:script>
		Liferay.Util.focusFormField(document.<portlet:namespace />fm.title);
	</aui:script>
</c:if>
